package main

import (
	"fmt"
	"github.com/jinzhu/gorm"
	_ "github.com/jinzhu/gorm/dialects/mysql"
)

type Student struct {
	Name string
	Age  int
	Id   uint
}

func main() {
	db, err := gorm.Open("mysql", "root:123456@(www.fluttergo.vip:3306)/test")
	if err != nil {
		fmt.Println(err)
	}
	defer db.Close()
	db.AutoMigrate(&Student{})
	user := Student{Name: "JOJO", Age: 43}
	db.Create(&user)
}
